package com.zmn.plat.services.impl.base.difficult.ratio;

import com.zmn.plat.model.entity.base.difficult.ratio.DifficultRatio;
import com.zmn.plat.model.entity.base.difficult.ratio.DifficultRatioQuery;
import com.zmn.plat.persistence.interfaces.base.difficult.ratio.DifficultRatioDao;
import com.zmn.plat.services.interfaces.base.difficult.ratio.DifficultRatioService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author tanbiao
 * @description
 * @modifier
 * @since 2021/1/8 18:20
 **/
@Service
public class DifficultRatioServiceImpl implements DifficultRatioService {
    @Resource
    private DifficultRatioDao difficultRatioDao;
    @Override
    public DifficultRatio findByKey(Integer difficultId) {
        return difficultRatioDao.findByKey(difficultId);
    }

    @Override
    public List<DifficultRatio> listPageByQuery(DifficultRatioQuery query) {
        int count = countByQuery(query);
        query.setTotalCount(count);
        return difficultRatioDao.listPageByQuery(query);
    }

    @Override
    public List<DifficultRatio> listByQuery(DifficultRatioQuery query) {
        return difficultRatioDao.listByQuery(query);
    }

    @Override
    public List<DifficultRatio> listAll() {
        return difficultRatioDao.listAll();
    }

    @Override
    public Integer countByQuery(DifficultRatioQuery query) {
        return difficultRatioDao.countByQuery(query);
    }

    @Override
    public Integer updateByKey(DifficultRatio difficultRatio) {
        return difficultRatioDao.updateByKey(difficultRatio);
    }

    @Override
    public Integer insert(DifficultRatio difficultRatio) {
        return difficultRatioDao.insert(difficultRatio);
    }

    @Override
    public Integer deleteByKey(Integer ratioId) {
        return difficultRatioDao.deleteByKey(ratioId);
    }

    @Override
    public Integer deleteByKeys(List<Integer> difficultIds) {
        return difficultRatioDao.deleteByKeys(difficultIds);
    }
}
